package cqut.wys.web;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * index跳转Servlet
 * @author wuyoushan@zbj.com
 * @date 2017/3/16.
 */
public class TestServlet extends HttpServlet{

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        this.doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        // super.doPost(req, resp);
        System.out.println("content" + req.getParameter("content"));
        req.getSession().setAttribute("content", req.getParameter("content"));
        req.getRequestDispatcher("index.jsp").forward(req, resp);
    }
}
